/**
 * 
 */
package com.sesame.daoimpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sesame.dao.ImageTagDAO;
import com.sesame.domain.ImageTag;

/**
 * @author shubeta
 *
 */
public class ImageTagDAOImpl extends SqlMapClientDaoSupport implements ImageTagDAO {

    public void addImageTag(ImageTag imagetag) {
        getSqlMapClientTemplate().insert("addImageTag", imagetag);
    }

    public void deleteImageTagById(Integer id) {
        getSqlMapClientTemplate().delete("deleteImageTagById", id);
    }
    
    @SuppressWarnings("unchecked")
    public List<ImageTag> getAllImageTag() {
        return (List<ImageTag>) getSqlMapClientTemplate().queryForList("getAllImageTag");
    }

    public ImageTag getImageTagById(Integer id) {
        return (ImageTag) getSqlMapClientTemplate().queryForObject("getImageTagById", id);
    }

    public void updateImageTag(ImageTag imagetag) {
        getSqlMapClientTemplate().update("updateImageTag", imagetag);
    }
}
